﻿using System.Web.Mvc;
using LandWeb.Models;

namespace MvcScriptBulid.Controllers
{
    public class DesignController : Controller
    {
        //
        // GET: /Design/
        [HttpGet]
        public ActionResult Grid()
        {           
            return View();
        }

        [HttpPost]
        public ActionResult Grid(GridProp prop)
        {
            GS.DataBase.IDbAccess iDb = GS.DataBase.DbAccessFactory.CreateInstance(Conn.sConnString, Conn.sDataBaseType);
            LANDFLOWGLOB role = new LANDFLOWGLOB();
            GS.DataBase.SearchListResult<LANDFLOWGLOB> list = role.SearchListByPage(iDb, "ID0", prop.PageSize, prop.SelectPage - 1, "", prop.OrderColumn, prop.OrderType);

            return Json(list);
        }

        [HttpGet]
        public ActionResult GridBtnGroup()
        {
            return View();
        }

        [HttpGet]
        public ActionResult Button()
        {
            return View();
        }

        [HttpGet]
        public ActionResult Index()
        {
            return View();
        }

        [HttpGet]
        public ActionResult Tree()
        {
            return View();
        }

        [HttpPost]
        public ActionResult GetTree(int iShowCheckBox)
        {
            GS.DataBase.IDbAccess iDb = GS.DataBase.DbAccessFactory.CreateInstance(Conn.sConnString, Conn.sDataBaseType);
            LARTYPE objModel = new LARTYPE();
            TreeModels tmModel = new TreeModels();

            tmModel = objModel.GetDictTree(iDb, iShowCheckBox);
          
            return Json(tmModel);
        }

        public ActionResult Dialog()
        {
            return View();
        }      
 
        [HttpGet]
        public ActionResult UserTree()
        {
            return View();
        }
    }
}
